3.8.95 \(\int \frac {\sec (c+d x) (B \sec (c+d x)+C \sec ^2(c+d x))}{a+b \sec (c+d x)} \, dx\) [795]

Optimal. Leaf size=98 \[ \frac {(b B-a C) \tanh ^{-1}(\sin (c+d x))}{b^2 d}-\frac {2 a (b B-a C) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b^2 \sqrt {a+b} d}+\frac {C \tan (c+d x)}{b d} \]

[Out]

(B*b-C*a)*arctanh(sin(d*x+c))/b^2/d-2*a*(B*b-C*a)*arctanh((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))/b^2/d/(a
-b)^(1/2)/(a+b)^(1/2)+C*tan(d*x+c)/b/d

________________________________________________________________________________________

Rubi [A]
time = 0.19, antiderivative size = 98, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, integrand size = 38, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {4157, 4095, 12, 3874, 3855, 3916, 2738, 214} \begin {gather*} \frac {(b B-a C) \tanh ^{-1}(\sin (c+d x))}{b^2 d}-\frac {2 a (b B-a C) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^2 d \sqrt {a-b} \sqrt {a+b}}+\frac {C \tan (c+d x)}{b d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(Sec[c + d*x]*(B*Sec[c + d*x] + C*Sec[c + d*x]^2))/(a + b*Sec[c + d*x]),x]

[Out]

((b*B - a*C)*ArcTanh[Sin[c + d*x]])/(b^2*d) - (2*a*(b*B - a*C)*ArcTanh[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a +
 b]])/(Sqrt[a - b]*b^2*Sqrt[a + b]*d) + (C*Tan[c + d*x])/(b*d)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 2738

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[2*(e/d), Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3874

Int[csc[(e_.) + (f_.)*(x_)]^2/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[1/b, Int[Csc[e + f*x],
 x], x] - Dist[a/b, Int[Csc[e + f*x]/(a + b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, e, f}, x]

Rule 3916

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[1/b, Int[1/(1 + (a/b)*Si
n[e + f*x]), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]

Rule 4095

Int[csc[(e_.) + (f_.)*(x_)]^2*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_
)), x_Symbol] :> Simp[(-B)*Cot[e + f*x]*((a + b*Csc[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Dist[1/(b*(m + 2)),
 Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^m*Simp[b*B*(m + 1) + (A*b*(m + 2) - a*B)*Csc[e + f*x], x], x], x] /; Fr
eeQ[{a, b, e, f, A, B, m}, x] && NeQ[A*b - a*B, 0] &&  !LtQ[m, -1]

Rule 4157

Int[((a_.) + csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(
x_)]^2*(C_.))*((c_.) + csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.), x_Symbol] :> Dist[1/b^2, Int[(a + b*Csc[e + f*x])
^(m + 1)*(c + d*Csc[e + f*x])^n*(b*B - a*C + b*C*Csc[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, m,
 n}, x] && EqQ[A*b^2 - a*b*B + a^2*C, 0]

Rubi steps

\begin {align*} \int \frac {\sec (c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx &=\int \frac {\sec ^2(c+d x) (B+C \sec (c+d x))}{a+b \sec (c+d x)} \, dx\\ &=\frac {C \tan (c+d x)}{b d}+\frac {\int \frac {(b B-a C) \sec ^2(c+d x)}{a+b \sec (c+d x)} \, dx}{b}\\ &=\frac {C \tan (c+d x)}{b d}+\frac {(b B-a C) \int \frac {\sec ^2(c+d x)}{a+b \sec (c+d x)} \, dx}{b}\\ &=\frac {C \tan (c+d x)}{b d}+\frac {(b B-a C) \int \sec (c+d x) \, dx}{b^2}-\frac {(a (b B-a C)) \int \frac {\sec (c+d x)}{a+b \sec (c+d x)} \, dx}{b^2}\\ &=\frac {(b B-a C) \tanh ^{-1}(\sin (c+d x))}{b^2 d}+\frac {C \tan (c+d x)}{b d}-\frac {(a (b B-a C)) \int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx}{b^3}\\ &=\frac {(b B-a C) \tanh ^{-1}(\sin (c+d x))}{b^2 d}+\frac {C \tan (c+d x)}{b d}-\frac {(2 a (b B-a C)) \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^3 d}\\ &=\frac {(b B-a C) \tanh ^{-1}(\sin (c+d x))}{b^2 d}-\frac {2 a (b B-a C) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b^2 \sqrt {a+b} d}+\frac {C \tan (c+d x)}{b d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.63, size = 130, normalized size = 1.33 \begin {gather*} \frac {-\frac {2 a (-b B+a C) \tanh ^{-1}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}-(b B-a C) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+b C \tan (c+d x)}{b^2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(Sec[c + d*x]*(B*Sec[c + d*x] + C*Sec[c + d*x]^2))/(a + b*Sec[c + d*x]),x]

[Out]

((-2*a*(-(b*B) + a*C)*ArcTanh[((-a + b)*Tan[(c + d*x)/2])/Sqrt[a^2 - b^2]])/Sqrt[a^2 - b^2] - (b*B - a*C)*(Log
[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]) + b*C*Tan[c + d*x])/(b^2*d)

________________________________________________________________________________________

Maple [A]
time = 0.20, size = 144, normalized size = 1.47

method result size
derivativedivides \(\frac {-\frac {C}{b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (-b B +a C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{2}}-\frac {C}{b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {\left (b B -a C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b^{2}}-\frac {2 a \left (b B -a C \right ) \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{b^{2} \sqrt {\left (a +b \right ) \left (a -b \right )}}}{d}\) \(144\)
default \(\frac {-\frac {C}{b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (-b B +a C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{2}}-\frac {C}{b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {\left (b B -a C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b^{2}}-\frac {2 a \left (b B -a C \right ) \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{b^{2} \sqrt {\left (a +b \right ) \left (a -b \right )}}}{d}\) \(144\)
risch \(\frac {2 i C}{d b \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{b d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{b^{2} d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {-i a^{2}+i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right ) B}{\sqrt {a^{2}-b^{2}}\, d b}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {-i a^{2}+i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right ) C}{\sqrt {a^{2}-b^{2}}\, d \,b^{2}}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right ) B}{\sqrt {a^{2}-b^{2}}\, d b}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right ) C}{\sqrt {a^{2}-b^{2}}\, d \,b^{2}}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{b d}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{b^{2} d}\) \(407\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)*(B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+b*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(-C/b/(tan(1/2*d*x+1/2*c)-1)+1/b^2*(-B*b+C*a)*ln(tan(1/2*d*x+1/2*c)-1)-C/b/(tan(1/2*d*x+1/2*c)+1)+(B*b-C*a
)/b^2*ln(tan(1/2*d*x+1/2*c)+1)-2*a*(B*b-C*a)/b^2/((a+b)*(a-b))^(1/2)*arctanh((a-b)*tan(1/2*d*x+1/2*c)/((a+b)*(
a-b))^(1/2)))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+b*sec(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?`
 for more de

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 208 vs. \(2 (90) = 180\).
time = 4.49, size = 472, normalized size = 4.82 \begin {gather*} \left [-\frac {{\left (C a^{2} - B a b\right )} \sqrt {a^{2} - b^{2}} \cos \left (d x + c\right ) \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) + {\left (C a^{3} - B a^{2} b - C a b^{2} + B b^{3}\right )} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (C a^{3} - B a^{2} b - C a b^{2} + B b^{3}\right )} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (C a^{2} b - C b^{3}\right )} \sin \left (d x + c\right )}{2 \, {\left (a^{2} b^{2} - b^{4}\right )} d \cos \left (d x + c\right )}, \frac {2 \, {\left (C a^{2} - B a b\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) \cos \left (d x + c\right ) - {\left (C a^{3} - B a^{2} b - C a b^{2} + B b^{3}\right )} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (C a^{3} - B a^{2} b - C a b^{2} + B b^{3}\right )} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (C a^{2} b - C b^{3}\right )} \sin \left (d x + c\right )}{2 \, {\left (a^{2} b^{2} - b^{4}\right )} d \cos \left (d x + c\right )}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+b*sec(d*x+c)),x, algorithm="fricas")

[Out]

[-1/2*((C*a^2 - B*a*b)*sqrt(a^2 - b^2)*cos(d*x + c)*log((2*a*b*cos(d*x + c) - (a^2 - 2*b^2)*cos(d*x + c)^2 - 2
*sqrt(a^2 - b^2)*(b*cos(d*x + c) + a)*sin(d*x + c) + 2*a^2 - b^2)/(a^2*cos(d*x + c)^2 + 2*a*b*cos(d*x + c) + b
^2)) + (C*a^3 - B*a^2*b - C*a*b^2 + B*b^3)*cos(d*x + c)*log(sin(d*x + c) + 1) - (C*a^3 - B*a^2*b - C*a*b^2 + B
*b^3)*cos(d*x + c)*log(-sin(d*x + c) + 1) - 2*(C*a^2*b - C*b^3)*sin(d*x + c))/((a^2*b^2 - b^4)*d*cos(d*x + c))
, 1/2*(2*(C*a^2 - B*a*b)*sqrt(-a^2 + b^2)*arctan(-sqrt(-a^2 + b^2)*(b*cos(d*x + c) + a)/((a^2 - b^2)*sin(d*x +
 c)))*cos(d*x + c) - (C*a^3 - B*a^2*b - C*a*b^2 + B*b^3)*cos(d*x + c)*log(sin(d*x + c) + 1) + (C*a^3 - B*a^2*b
 - C*a*b^2 + B*b^3)*cos(d*x + c)*log(-sin(d*x + c) + 1) + 2*(C*a^2*b - C*b^3)*sin(d*x + c))/((a^2*b^2 - b^4)*d
*cos(d*x + c))]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (B + C \sec {\left (c + d x \right )}\right ) \sec ^{2}{\left (c + d x \right )}}{a + b \sec {\left (c + d x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(B*sec(d*x+c)+C*sec(d*x+c)**2)/(a+b*sec(d*x+c)),x)

[Out]

Integral((B + C*sec(c + d*x))*sec(c + d*x)**2/(a + b*sec(c + d*x)), x)

________________________________________________________________________________________

Giac [A]
time = 0.51, size = 175, normalized size = 1.79 \begin {gather*} -\frac {\frac {{\left (C a - B b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{b^{2}} - \frac {{\left (C a - B b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{b^{2}} + \frac {2 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} b} + \frac {2 \, {\left (C a^{2} - B a b\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )}}{\sqrt {-a^{2} + b^{2}} b^{2}}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+b*sec(d*x+c)),x, algorithm="giac")

[Out]

-((C*a - B*b)*log(abs(tan(1/2*d*x + 1/2*c) + 1))/b^2 - (C*a - B*b)*log(abs(tan(1/2*d*x + 1/2*c) - 1))/b^2 + 2*
C*tan(1/2*d*x + 1/2*c)/((tan(1/2*d*x + 1/2*c)^2 - 1)*b) + 2*(C*a^2 - B*a*b)*(pi*floor(1/2*(d*x + c)/pi + 1/2)*
sgn(2*a - 2*b) + arctan((a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1/2*c))/sqrt(-a^2 + b^2)))/(sqrt(-a^2 + b^2)
*b^2))/d

________________________________________________________________________________________

Mupad [B]
time = 4.57, size = 719, normalized size = 7.34 \begin {gather*} \frac {2\,C\,a\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d\,\left (a^2-b^2\right )}-\frac {2\,B\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d\,\left (a^2-b^2\right )}-\frac {C\,b\,\mathrm {tan}\left (c+d\,x\right )}{d\,\left (a^2-b^2\right )}-\frac {C\,a^2\,\ln \left (\frac {a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d\,{\left (a^2-b^2\right )}^{3/2}}+\frac {2\,B\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{b\,d\,\left (a^2-b^2\right )}-\frac {2\,C\,a^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{b^2\,d\,\left (a^2-b^2\right )}-\frac {B\,a^3\,\ln \left (\frac {a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{b\,d\,{\left (a^2-b^2\right )}^{3/2}}+\frac {C\,a^4\,\ln \left (\frac {a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{b^2\,d\,{\left (a^2-b^2\right )}^{3/2}}+\frac {B\,a\,b\,\ln \left (\frac {a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d\,{\left (a^2-b^2\right )}^{3/2}}+\frac {C\,a^2\,\mathrm {tan}\left (c+d\,x\right )}{b\,d\,\left (a^2-b^2\right )}-\frac {C\,a^2\,\ln \left (\frac {b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\sqrt {\left (a+b\right )\,\left (a-b\right )}}{b^2\,d\,\left (a^2-b^2\right )}+\frac {B\,a\,\ln \left (\frac {b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\sqrt {\left (a+b\right )\,\left (a-b\right )}}{b\,d\,\left (a^2-b^2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B/cos(c + d*x) + C/cos(c + d*x)^2)/(cos(c + d*x)*(a + b/cos(c + d*x))),x)

[Out]

(2*C*a*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/(d*(a^2 - b^2)) - (2*B*b*atanh(sin(c/2 + (d*x)/2)/cos(c/2
 + (d*x)/2)))/(d*(a^2 - b^2)) - (C*b*tan(c + d*x))/(d*(a^2 - b^2)) - (C*a^2*log((a*sin(c/2 + (d*x)/2) - b*sin(
c/2 + (d*x)/2) + cos(c/2 + (d*x)/2)*(a^2 - b^2)^(1/2))/cos(c/2 + (d*x)/2)))/(d*(a^2 - b^2)^(3/2)) + (2*B*a^2*a
tanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/(b*d*(a^2 - b^2)) - (2*C*a^3*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (
d*x)/2)))/(b^2*d*(a^2 - b^2)) - (B*a^3*log((a*sin(c/2 + (d*x)/2) - b*sin(c/2 + (d*x)/2) + cos(c/2 + (d*x)/2)*(
a^2 - b^2)^(1/2))/cos(c/2 + (d*x)/2)))/(b*d*(a^2 - b^2)^(3/2)) + (C*a^4*log((a*sin(c/2 + (d*x)/2) - b*sin(c/2
+ (d*x)/2) + cos(c/2 + (d*x)/2)*(a^2 - b^2)^(1/2))/cos(c/2 + (d*x)/2)))/(b^2*d*(a^2 - b^2)^(3/2)) + (B*a*b*log
((a*sin(c/2 + (d*x)/2) - b*sin(c/2 + (d*x)/2) + cos(c/2 + (d*x)/2)*(a^2 - b^2)^(1/2))/cos(c/2 + (d*x)/2)))/(d*
(a^2 - b^2)^(3/2)) + (C*a^2*tan(c + d*x))/(b*d*(a^2 - b^2)) - (C*a^2*log((b*sin(c/2 + (d*x)/2) - a*sin(c/2 + (
d*x)/2) + cos(c/2 + (d*x)/2)*(a^2 - b^2)^(1/2))/cos(c/2 + (d*x)/2))*((a + b)*(a - b))^(1/2))/(b^2*d*(a^2 - b^2
)) + (B*a*log((b*sin(c/2 + (d*x)/2) - a*sin(c/2 + (d*x)/2) + cos(c/2 + (d*x)/2)*(a^2 - b^2)^(1/2))/cos(c/2 + (
d*x)/2))*((a + b)*(a - b))^(1/2))/(b*d*(a^2 - b^2))

________________________________________________________________________________________